#ifndef __MEMENTO_H__
#define __MEMENTO_H__
#include <iostream>
#include <string>
#include <memory>
#include <unordered_map>
#include <chrono>


class PlayMemento{
private:
    int m_blood;
    int m_magic;
    int m_attack;
public:
    PlayMemento(int blood,int magic,int attack):m_blood(blood),m_magic(magic),m_attack(attack){}
    int getBlood(){
        return m_blood;
    }

    int getMagic(){
        return m_magic;
    }

    int getAttack(){
        return m_attack;
    }
};


class Player{
private:
    int m_blood;
    int m_magic;
    int m_attack;

public:
    Player(int b,int m,int a):m_blood(b),m_magic(m),m_attack(a){}
    void showStatus();
    
    void attacked(){
        m_blood -=10;
        m_attack +=10;
    }

    std::shared_ptr<PlayMemento> StorePlayerFile();

    void ReadPlayFile(std::shared_ptr<PlayMemento> memento);


};

class PlayManager{
private:
    std::unordered_map<uint16_t,std::shared_ptr<PlayMemento>> m_time_memento_map;

public:
    void setPlayMemento(uint16_t time, std::shared_ptr<PlayMemento> playmemento);
    std::shared_ptr<PlayMemento> getPlayMemento(uint16_t time);
};

#endif